Image processing apparatus

ABSTRACT

An image processing apparatus includes an acquisition unit configured to acquire a bitmap image in which each of contained pixels has an alpha value indicating opacity of this pixel, and a rendering unit configured to render the bitmap image. The rendering unit is configured to, when rendering the bitmap image, refrain from performing alpha blending on a pixel contained in the bitmap image that has a specific alpha value and perform the alpha blending on a pixel contained in the bitmap image that has a different alpha value from the specific alpha value.

BACKGROUND OF THE INVENTION

Field of the Invention

The present invention relates to a technique for processing image datacontaining an alpha channel.

Description of the Related Art

In recent years, image data in the Portable Network Graphics (PNG)format has been becoming widely handled. The image data in the PNGformat is bitmap image data containing, for each pixel, a color value(for example, a Red/Green/Blue (RGB) value) of a pixel, and an alphavalue (an α value) that expresses opacity (transparency) of this pixel.

Image data containing a plurality of pixels each having an α value isrendered by alpha (α) blending when being rendered on a foreground(i.e., on top of a background). The α blending is a method that combinesa pixel (or an image) having an opacity with another image based on thisopacity. Rendering by a common type of the α blending is renderingprocessing that combines the color value held by the pixel to berendered on the foreground with the color value held by the backgroundpixel based on the α value of this foreground pixel (i.e., processingthat calculates a weighted average of them). For example, if atransparent pixel (a pixel having an α value indicating that this pixelis transparent (completely transparent)) is rendered on the foreground,a pixel resulting from the rendering processing by the α blending has acolor value held by the background pixel. On the other hand, forexample, if an opaque pixel (a pixel having an α value indicating thatthis pixel is opaque (completely opaque)) is rendered on the foreground,a pixel resulting from the rendering processing by the α blending has acolor value held by the foreground pixel.

The rendering processing by the α blending requires a large amount ofcalculation due to the above-described processing that combines thecolor values. Therefore, Japanese Patent Application Laid-Open No.2006-244248 aims at speeding up the rendering by omitting the α blendingfor all pixels in image data, if the individual pixels contained in theimage data are constituted by either the transparent pixels or theopaque pixels.

In other words, according to Japanese Patent Application Laid-Open No.2006-244248, the α blending is omitted, if the image data is constitutedby only the transparent pixels or only the opaque pixels.

SUMMARY OF THE INVENTION

According to an aspect of the present invention, an image processingapparatus includes an acquisition unit configured to acquire a bitmapimage including a plurality of pixels, each of the plurality of thepixels having an alpha value indicating an opacity of the pixel, and arendering unit configured to perform a rendering of the bitmap imageusing alpha blending, wherein, in the rendering of the bitmap image bythe rendering unit, alpha blending is not performed on a pixel of theplurality of the pixels that has a specific alpha value but is performedon a pixel of the plurality of the pixels that has a different alphavalue than the specific alpha value.

Further features of the present invention will become apparent from thefollowing description of exemplary embodiments with reference to theattached renderings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a hardware block diagram of an image processing apparatusaccording to a first exemplary embodiment.

FIG. 2 is a software block diagram of the image processing apparatusaccording to the first exemplary embodiment.

FIGS. 3A, 3B, and 3C illustrate a Page Description Language (PDL)command, a rendering command, and a display list, respectively.

FIGS. 4A, 4B, and 4C illustrate a bitmap edge.

FIG. 5 is a flowchart from PDL interpretation processing to renderingprocessing according to the first exemplary embodiment.

FIG. 6 is a flowchart of α determination processing according to thefirst exemplary embodiment.

FIGS. 7A, 7B, and 7C illustrate display lists each containing the bitmapedge that is generated from image data containing an α channel.

FIGS. 8A, 8B, and 8C illustrate a difference made when a vector edge andthe bitmap edge are switched with respect to the first exemplaryembodiment.

DESCRIPTION OF THE EMBODIMENTS

An alpha (α) value indicates an opacity that a pixel has.

A transparent (completely transparent) pixel is a pixel having the αvalue indicating that this pixel is transparent (completely transparent)(for example, 0, which is a minimum value). A color value acquired byrendering the transparent pixel on a background pixel with use of analpha blending (an α blending) is a color value of this backgroundpixel. In other words, the result of rendering the transparent pixel canbe regarded as a pixel that is not rendered.

A translucent pixel is a pixel having an α value indicating that thispixel is translucent (semi-transparent) (for example, 1 or larger, and254 or smaller). A color value acquired by rendering the translucentpixel on the background pixel with use of the α blending is a valuecalculated by combining a color value of this translucent pixel and acolor value of this background pixel.

An opaque (completely opaque) pixel is a pixel having the α valueindicating that this pixel is opaque (completely opaque) (for example,255, which is a maximum value). A color value acquired by rendering theopaque pixel on the background pixel with use of the α blending is acolor value of this opaque pixel. In other words, the result ofrendering the opaque pixel can be regarded as a pixel rendered while thebackground pixel is overwritten therewith.

A term “non-transparent pixel” will be used to collectively refer to thetranslucent pixel and the opaque pixel. In other words, thenon-transparent pixel can be regarded as a rendered pixel.

The α blending is the method that, assuming that a pixel to be renderedbecomes the foreground and a pixel in another image becomes thebackground, combines the foreground pixel with the background pixelbased on the α value held by the foreground pixel. A color valueacquired from the rendering by the common type of the α blending is asum of the color value held by the foreground pixel that is multipliedby (the α value/the maximum value of the α value), and the color valueheld by the background pixel that is multiplied by (1−(the α value/themaximum value of the α value)).

In the following description, an exemplary embodiment for embodying thepresent invention will be described with reference to the drawings.

When a term “binary bitmap” is used in the following description, thebinary bitmap refers to bitmap image data expressed by one bit perpixel.

FIG. 1 is a hardware block diagram illustrating an image processingapparatus according to the present exemplary embodiment. In the presentexemplary embodiment, an image forming apparatus 100 will be describedas one example of the image processing apparatus. This image formingapparatus 100 may be a multi function peripheral (MFP), or may be asingle function printer (SFP).

The image forming apparatus 100 communicates with a host computer (forexample, a personal computer) 170 via a local area network (LAN) 160,such as Ethernet®.

The above-described image forming apparatus 100 includes a controldevice (a controller unit) 110, a printer device (a printer unit) 130, adata storage unit 150, and a not-illustrated network interface (I/F).The control device 110 controls the printer device 130 and the datastorage unit 150.

The control device 110 includes a central processing unit (CPU), a readonly memory (ROM), and a random access memory (RAM), which are notillustrated. This CPU comprehensively controls the entire image formingapparatus 100 by loading a program stored in this ROM or the datastorage unit 150 into this RAM and executing the loaded program. Thisexecution of the program by the CPU causes the control device 110 toperform Page Description Language (PDL) reception processing, PDLinterpretation processing, intermediate data generation processing, andrendering processing.

The control device 110 receives page description language (PDL) data(print data) written in a PDL, such as Extensible Markup Language (XML)Paper Specification (XPS) and PostScript, from the host computer 170 viathe above-described network I/F, and stores the received PDL data intothe data storage unit 150. The data storage unit 150 is, for example, ahard disk drive (HDD) or a solid state drive (SSD). The control device110 performs the PDL interpretation processing on the stored PDL data,and performs the intermediate data generation processing based on aresult of this interpretation. As a result of the intermediate datageneration processing, intermediate data called a display list isgenerated as much as the number of page(s). Then, the control device 110generates bitmap image data of a page by performing the renderingprocessing for each page based on the generated intermediate data. Thecontrol device 110 stores the generated bitmap image data into the datastorage unit 150. And then, the control device 110 supplies such storedbitmap image data to the printer device 130.

In the present exemplary embodiment, the CPU in the control device 110performs the rendering processing, but the present exemplary embodimentmay be configured in such a manner that a raster image processor (RIP)is provided in the control device 110 as another processor than the CPU,and this RIP performs the rendering processing.

The printer device 130 prints an image onto a recording medium (forexample, paper and an overhead projector (OHP) sheet) based on thebitmap image data supplied from the control device 110. A print methodof this printer device 130 may be any of various kinds of print methods,such as an electrophotographic method and an inkjet method.

FIG. 2 is a block diagram illustrating one example of a software modulediagram that is realized by the execution of the above-described programby the not-illustrated CPU in the control device 110 according to thepresent exemplary embodiment.

A job control unit 200 receives the PDL data generated by the hostcomputer 170 via the LAN 160, and stores the received PDL data into thedata storage unit 150. Then, the job control unit 200 instructs a PDLinterpretation unit 205, an intermediate data generation unit 210, and arendering unit 215 to start processing.

After receiving the instruction to start the processing from the jobcontrol unit 200, the PDL interpretation unit 205 interprets the PDLdata stored in the data storage unit 150, and issues a rendering commandbased on this interpretation to the intermediate data generation unit210. This PDL interpretation unit 205 can interpret, for example, thePDL data (the print data) written in PostScript or XPS.

After receiving the instruction to start the processing from the jobcontrol unit 200, the intermediate data generation unit 210 generatesthe intermediate data from the rendering command issued from the PDLinterpretation unit 205, and stores the generated intermediate data intothe RAM in the control device 110. Such intermediate data generationprocessing will be described below in detail with reference to FIG. 6.

When the intermediate data corresponding to a single page is stored intothe RAM by the intermediate data generation unit 210, the rendering unit215 reads in the intermediate data from this RAM after receiving theinstruction to start the processing from the job control unit 200. Then,the rendering unit 215 performs the rendering processing based on thisintermediate data, thereby rendering the bitmap image data correspondingto the single page into the RAM. Rendering the bitmap image datacorresponding to the single page into the RAM means writing an RGB valueof a pixel contained in this page into a corresponding address in theRAM. The rendering unit 215 stores the bitmap image data correspondingto the single page in the RAM into the data storage unit 150. Suchbitmap image data stored in the data storage unit 150 is supplied to theprinter device 130 by the job control unit 200.

FIGS. 3A to 3C are schematic diagrams illustrating the PDL data, therendering command issued based on the interpretation of this PDL data,and the intermediate data generated from this rendering command.Especially, a vector edge (which will be described below) will bedescribed with reference to FIGS. 3A to 3C.

<Vector Edge>

FIG. 3A illustrates an example of the PDL data generated by the hostcomputer 170. For example, the PDL data indicates a command to render anobject (a PDL command) 300 written in XPS. Path elements of XPS arewritten in this PDL command 300. The written contents are commands suchas a command specifying a region to be rendered, and a command to paint(brush) the inside of this region. More specifically, specifying theregion to be rendered as a path indicating a rectangle, and painting theinside of this rectangular region with bitmap image data (1-1.PNG) inthe PNG format are written in the PDL command 300 illustrated in FIG.3A. This bitmap image data in the PNG format is the image datacontaining an alpha channel (an α channel). In other words, the imagedata has channels of three color values indicating respective luminancesof a red (R) color, a green (G) color, and a blue (B) color, and thesingle a channel indicating opacity, i.e., four channels in total, andeach pixel has the RGB value and the α value (i.e., the RGBα value). Inthe present exemplary embodiment, each of the channels is expressed by 8bits. For example, a pixel having an RGBα value=(0, 0, 0, 255) is anopaque black pixel, and a pixel having an RGBα value=(0, 0, 0, 0) is atransparent black pixel. Further, a pixel having an α value of 1 orlarger and 254 or smaller is a translucent pixel. For example, a pixelhaving an RGBα value=(0, 0, 0, 128) is a translucent black pixel.

FIG. 3B illustrates a rendering command 310 that is issued by theinterpretation of the PDL command 300 illustrated in FIG. 3A by the PDLinterpretation unit 205. The rendering command 310 contains path data311, composite data 312, and source image data 313.

The path data 311 contains coordinate data indicating the region of anobject to be rendered. This coordinate data is upper left coordinates(50, 0) and lower right coordinates (250, 50) of the region of theobject to be rendered.

The composite data 312 indicates that a method for combining the objectto be rendered with a background object is the Over method in thePorter-Duff technique.

The source image data 313 indicates that the inside of the region of theobject to be rendered will be painted with the image data “1-1.PNG”. Theimage data “1-1.PNG” in the present example is bitmap image data havinga height of 50 pixels and a width of 200 pixels as indicated by thesource image data 313 illustrated in FIG. 3B. An upper left pixel and alower right pixel of this bitmap image data each have the RGBα value (0,0, 0, 255), and the other pixels each have the RGBα value (0, 0, 0, 0).In other words, the upper left pixel and the lower right pixel areopaque, and the other pixels are transparent.

Types of the path data in the rendering command also include path datacontaining a binary bitmap, besides the path data containing thecoordinate data like the above-described path data. The path datacontaining the binary bitmap will be described below with reference toFIG. 4.

FIG. 3C illustrates one example of a display list (intermediate data)320 generated by the intermediate data generation unit 210 from therendering command 310 illustrated in FIG. 3B. The display list 320contains edge data 321, level data 322, and fill data 323. These datapieces have such a list structure that the fill data 323 is referred tofrom the level data 322, and the level data 322 is referred to from theedge data 321. The rendering unit 215 performs the rendering processingof the page while reading in the edge data 321 from the display list320, and referring to the level data 322 and the fill data 323sequentially.

The edge data 321 is generated from the path data 311 in the renderingcommand 310. Since the path data 311 in the present example contains thecoordinate data, the type of the generated edge data 321 is a vectoredge. The vector edge is a pair of downward and upward edges. Each edgeof the downward and upward edges indicates an end of the region of theobject to be rendered. The downward edge contained in the edge data 321illustrated in FIG. 3C indicates a left end of the rectangular object asa vector connecting coordinates (50, 0) and (50, 50). The upward edgeindicates a right end of the rectangular objet as a vector connectingcoordinates (250, 0) and (250, 50). A region (a sector) on a scan linesandwiched between a downward edge and an upward edge of an object is aregion where this object will be rendered (an active region), andanother region is an inactive region with respect to this object.

The level data 322 contains a level number indicating an order in whichthe object to be rendered will be overlaid, an operator indicating amethod for combining this object with the background, and a fill dataaddress indicating how the inside of the region of the object will bepainted. The level number illustrated in FIG. 3C is “1”, which indicatesthat this object will be rendered on a lowermost layer in the overlayingorder. The operator illustrated in FIG. 3C is “Over”, which correspondsto the composite data 312. The fill data address illustrated in FIG. 3Cis an address for referring to the fill data 323.

The fill data 323 indicates the image data that will be used to paintthe inside of the region of the object to be rendered. The image dataindicated by the fill data 323 illustrated in FIG. 3C is the same as thesource image data 313 (1-1.PNG).

The rendering processing by the rendering unit 215 based on the displaylist containing the above-described vector edge is performed on allpixels in the active region indicated by the vector edge (i.e., allpixels in the object). In other words, each of the pixels in the activeregion is rendered based on the image data indicated by the fill dataand the combining method indicated by the level data.

Especially, in the case where the bitmap image data containing pixelseach having the α value is rendered with use of the vector edge, therendering unit 215 identifies the entire region to be rendered in thisimage data as the active region based on the vector edge. Then, therendering unit 215 renders each of the pixels in the image data by the αblending based on the α value held by each of the pixels withoutdetecting a boundary between a pixel to be rendered and a pixel to benot rendered in the bitmap image data. On the contrary, the renderingunit 215 does not perform such rendering processing on pixels in theinactive region. As a result, the rendering processing on the inactiveregion can be omitted, which contributes to speeding up the processingfor rendering the page.

For example, in the rendering processing based on the display list 320,since the image data indicated by the fill data 323 contains the pixelhaving the α value, the α blending between this pixel and the backgroundpixel is performed on each of the pixels in the active region. Then, inthe image data indicated by the fill data 323 in the display list 320,the pixels are transparent except for the upper left and lower rightpixels, so that the α blending performed on the transparent pixels endsup wasteful processing. This is because the same result can be acquiredby only outputting the color value of the background pixel directlywithout performing the α blending.

<Bitmap Edge>

In the case where the path data in the rendering command contains thebinary bitmap, a generated display list is different than the displaylist 320. More specifically, the type of the edge data contained in thedisplay list is a bitmap edge (which will be described below). Thisbitmap edge will be described with reference to FIGS. 4A to 4C.

The binary bitmap contained in the path data is, for example, a binarybitmap configured as illustrated in FIG. 4A. In the binary bitmapillustrated in FIG. 4A, a contour of a character is defined by positionsof bits (bit values) set to “1”, and the contour of the characterindicates the number “1”. Pixels having the bits set to “1” are paintedwith the image data specified in the source image data. For example, ifthe source image data is an RGB value (0, 0, 0), the pixels having thebits set to “1” are painted black. Further, the path data also containsdata indicating coordinates of a left end of the binary bitmap that iscalled a main edge, besides the binary bitmap. In the case of the pathdata containing the binary bitmap configured as described above, thebinary bitmap is contained in the bitmap edge.

A display list illustrated in FIG. 4B is generated from such a renderingcommand. More specifically, the edge data that is the bitmap edge isgenerated. The bitmap edge contains the main edge indicating thecoordinate positions of the left end of the object, and the binarybitmap. Level data illustrated in FIG. 4B is referred to from thisbitmap edge, and fill data is referred to from this level data. Thecontent of the level data is similar to the level data 322. Further,this fill data is a monochrome fill, and is generated from the sourceimage data contained in the rendering command. In the present example,the fill data is the black color indicated by the RGB value (0, 0, 0).

The rendering processing performed based on the display list containingthe bitmap edge generated in this manner will be described. Uponacquiring the display list containing the bitmap edge, the renderingunit 215 detects switching of a bit from the binary bitmap contained inthe bitmap edge. A position of this switching indicates, i.e., aboundary position between the transparent pixel (i.e., the pixel to benot rendered) and the non-transparent pixel (the pixel to be rendered).Then, the rendering unit 215 generates a downward edge and an upwardedge based on a result of such detection. The downward edge is generatedat a position contained in the binary bitmap where the pixel is switchedfrom the pixel having the bit set “0” to the pixel having the bit set to“1” (the boundary position). The upward edge is generated at a positioncontained in the binary bitmap where the pixel is switched from thepixel having the bit set to “1” to the pixel having the bit set to “0”(the boundary position). The generated edges are illustrated in FIG. 4C.As understood from edge data illustrated in FIG. 4C, two downward edgesand two upward edges are generated from the bitmap edge. The renderingunit 215 performs the rendering processing based on the level data andthe fill data on each of the pixels in the active region sandwichedbetween the downward edge and the upward edge, similarly to therendering processing performed based on the display list 320. On theother hand, the rendering unit 215 does not perform the renderingprocessing on the pixels in the inactive region. Therefore, for example,if the image data indicated by the fill data contains the pixel havingthe α value, the rendering unit 215 performs the α blending on thepixels in the active region but does not perform the α blending on thepixels in the inactive region.

Further, the rendering unit 215 may identify the opaque pixel (orregion) in the active region, and render this pixel (or region) byoverwriting the background with this pixel without use of the α blendingto further omit the α blending.

Generating the edge data as the bitmap edge in this manner allows therendering processing to be partially omitted, although requiring a costto process the edge in the rendering processing. Therefore, performingthe rendering processing with use of the bitmap edge can be expected tobe sped up compared to performing the rendering processing with use ofthe vector edge, when rendering an object having a portion where thetransparent pixels exist in a cluster.

<Generation of Display List>

FIG. 5 is a flowchart illustrating the intermediate data (display list)generation processing performed by the control device 110 according tothe present exemplary embodiment. This flow is performed by the softwaremodules realized by the execution of the above-described program by thenot-illustrated CPU in the control device 110. The job control unit 200instructs the PDL interpretation unit 205, the intermediate datageneration unit 210, and the rendering unit 215 to start the processing,according to which the processing of this flow starts.

In step S501, the PDL interpretation unit 205 reads in the PDL datastored in the data storage unit 150. Then, the processing proceeds tostep S502. The PDL data read at this time contains a plurality of PDLcommands. This plurality of PDL commands includes PDL commands such ascommands to start a job, start a page, end the page, and end the job,and the PDL command instructing the image forming apparatus 100 torender an object.

In step S502, the PDL interpretation unit 205 acquires one of PDLcommands that are not yet interpreted, sequentially, starting from ahead of the PDL data, as a PDL command set as a processing target. ThePDL interpretation unit 205 interprets the PDL command set as theprocessing target. Then, the processing proceeds to step S503.

In step S503, the PDL interpretation unit 205 determines whether the PDLcommand set as the processing target is the command to end the job. Ifthe PDL command set as the processing target is the command to end thejob (YES in step S503), the processing illustrated in the presentflowchart ends. If not (NO in step S503), the processing proceeds tostep S504.

In step S504, the PDL interpretation unit 205 determines whether the PDLcommand set as the processing target is the command to end the page. Ifthe PDL command set as the processing target is the command to end thepage (YES in step S504), the processing proceeds to step S514. If not(NO in step S504), this means that the PDL command set as the processingtarget is the PDL command to instruct the image forming apparatus 100 torender the object, so that the processing proceeds to step S505.

In step S505, the PDL interpretation unit 205 generates a command torender the object based on the interpretation of the PDL command set asthe processing target. Then, the PDL interpretation unit 205 issues thisrendering command to the intermediate data generation unit 210. Then,the processing proceeds to step S506.

In step S506, the intermediate data generation unit 210 determineswhether the path data in the issued rendering command contains a binarybitmap. If the path data contains a binary bitmap (for example, FIG. 4A)(YES in step S506), the processing proceeds to step S511. If the pathdata does not contain a binary bitmap but contains coordinate data (forexample, FIG. 3B) (NO in step S506), the processing proceeds to stepS507.

In step S507, the intermediate data generation unit 210 determineswhether the rendering command issued in step S505 is a rendering commandwith respect to the bitmap image data containing an α channel. Morespecifically, the intermediate data generation unit 210 makes suchdetermination by checking the fill data in the rendering command.

For example, if the bitmap image data containing an α channel (forexample, the bitmap image data in the PNG format that contains an αchannel) is specified in the fill data, the intermediate data generationunit 210 determines that the rendering command is the rendering commandwith respect to the bitmap image data containing an α channel (YES instep S507). Then, the processing proceeds to step S508.

On the other hand, for example, if an opaque monochrome fill that doesnot contain an α value is specified in the fill data, the intermediatedata generation unit 210 determines that the rendering command is notthe rendering command with respect to the bitmap image data containingan α channel (NO in step S507). Then, the processing proceeds to stepS513.

In step S508, the intermediate data generation unit 210 determineswhether an area of the bitmap image data specified in the fill data instep S507 is a threshold value or larger. If the area of the bitmapimage data is the threshold value or larger (YES in step S508), theprocessing proceeds to step S509. If not (NO in step S508), theprocessing proceeds to step S513. The intermediate data generation unit210 makes such determination for the following reasons.

A calculation amount of combining processing (the α blending) is not sogreat even when the combining processing is performed on each pixel inthe bitmap image data having an area smaller than the threshold value.On the other hand, when such bitmap image data is subject to alpha (α)determination processing in step S509, which will be described below,the determination processing takes a greater calculation amount. Anotherreason is that, even if the display list containing the bitmap edge isgenerated from the image data having a small area, the edge is generatedin the rendering processing and the calculation amount increases whenthe edge is processed, so that the rendering processing cannot beexpected to be sped up so much.

Therefore, the intermediate data generation unit 210 does not performthe α determination processing in step S509 on the bitmap image datahaving an area smaller than the threshold value, and then the processingproceeds to step S513.

In step S509, the intermediate data generation unit 210 performs the αdetermination processing. In the α determination processing, theintermediate data generation unit 210 analyzes the bitmap image datacontaining the α channel, and sets a bitmap edge generation flag basedon this analysis. For example, if the source image data is image data701 illustrated in FIG. 7A, the bitmap edge generation flag is set to“1”. If the source image data is image data 702 illustrated in FIG. 7A,the bitmap edge generation flag is set to “0”. The image data 701 isequivalent to the source image data 313. Further, the image data 702 isgrid-like image data having a height of 50 pixels and a width of 200pixels with the transparent pixel and the opaque pixel alternatelyarranged. Such a determination processing will be described below withreference to FIG. 6. Then, the processing proceeds to step S510.

In step S510, the intermediate data generation unit 210 determineswhether the bitmap edge generation flag is set to “1”. If the bitmapedge generation flag is set to “1” (YES in step S510), the processingproceeds to step S512. If not (NO in step S510), the processing proceedsto step S513.

In step S511, the intermediate data generation unit 210 generates theintermediate data containing the bitmap edge like the bitmap edgeillustrated in FIG. 4B.

In step S512, the intermediate data generation unit 210 generates theintermediate data containing the bitmap edge based on the α channel (theα value of each of the pixels) contained in the image data. As will bedescribed below, the intermediate data generation unit 210 generates theintermediate data containing the bitmap edge based on the α channel (theα value of each of the pixels), which causes the rendering unit 215 toexhibit the following behavior in step S514. That is, the rendering unit215 omits the rendering itself for a pixel having a specific α value(the α value indicating that this pixel is transparent), and renders apixel having another α value than that (the α value indicating that thispixel is translucent or opaque) with use of the α blending. Rephrasingthat from another viewpoint, the generation of the bitmap edge by stepS512 allows the rendering unit 215 to perform the following processing:(1) processing for dividing pixels into the pixel (region) that has tobe rendered and the pixel (region) that does not have to be renderedfrom each other, and (2) processing for rendering the pixel (region)that has to be rendered with use of the α blending.

Such intermediate data generation processing will be described withreference to FIG. 7B. In the following description, the intermediatedata generation processing will be described, assuming that thisprocessing generates the intermediate data containing the bitmap edgewhen the source image data is the image data 701.

First, the intermediate data generation unit 210 generates a binarybitmap having the same size as the size (the width and the height) ofthe image data indicated by the source image data. Each of pixelscontained in this binary bitmap corresponds to each of the pixelscontained in the image data indicated by the source image data. In otherwords, a pixel located at a coordinate position (X, Y) in the binarybitmap corresponds to a pixel located at a coordinate position (X, Y) inthe image data indicated by the source image data.

Then, the intermediate data generation unit 210 refers to the α value ofeach of the pixels contained in the image data indicated by the sourceimage data. If the α value indicates that the pixel is transparent(i.e., if the α value is the specific alpha value), the intermediatedata generation unit 210 sets the bit of the pixel located at thecorresponding position in the binary bitmap to “0”. On the other hand,if the α value indicates that the pixel is translucent or opaque (i.e.,if the α value is different than the specific alpha value), theintermediate data generation unit 210 sets the bit of the pixel locatedat the corresponding position in the binary bitmap to “1”. The bit “0”or the bit “1” set to each of the pixels in the binary bitmap isinformation indicating whether the rendering is omitted or performed onthe pixel in the image data indicated by the source image data that islocated at the position corresponding to the pixel in the binary bitmap.In other words, the binary bitmap with the bit set to each of the pixelsis information indicating the region to be not rendered and the regionto be rendered in the image data indicated by the source image data.

Next, the intermediate data generation unit 210 calculates an edgeindicating the position of the left end of the object from thecoordinate data contained in the path data, and generates this edge asthe main edge.

The intermediate data generation unit 210 adds the generated binarybitmap and main edge into edge data 721. Then, the intermediate datageneration unit 210 generates level data 722 and fill data 723,similarly to the level data 322 and the fill data 323 in the displaylist 320. Lastly, the intermediate data generation unit 210 enables thelevel data 722 to be referred to from the edge data 721 and the filldata 723 to be referred to from the level data 722, thereby generating adisplay list 720 containing the bitmap edge. This fill data 723 is thebitmap image data 701 containing the plurality of pixels each having theα value.

The method for generating the display list containing the bitmap edge isnot limited to the above-described example, and a method for generatinga display list 740 illustrated in FIG. 7C may be added. The generationof edge data 741 is similarly to the generation of the edge data 721,and therefore a description thereof will be omitted here. Theintermediate data generation unit 210 refers to the α value of each ofthe pixels contained in the image data indicated by the source imagedata, and generates level data 742 and fill data 743 if checking thatthere is not an α value indicating that the pixel is translucent. Thelevel data 742 contains a “0×C” operator, which instructs the renderingunit 215 to overwrite the background pixel. Further, if the color valueis the same among the pixels each having the α value indicating thatthis pixel is opaque in the image data indicated by the source imagedata, the intermediate data generation unit 210 generates a monochromefill having this color value (Example: RGB=(0, 0, 0)) as the fill data743. On the other hand, if the color value is different among the pixelseach having the α value indicating that this pixel is opaque in theimage data indicated by the source image data, the intermediate datageneration unit 210 generates the image data with the α channel removedfrom the image data indicated by the source image data, as the fill data743. Generating such a display list allows the rendering unit 215 toperform the rendering processing only on the pixels in the active regionwhile omitting the α blending more complex than overwriting from thisrendering processing.

The rendering unit 215 renders the display list, containing the bitmapedge, which is generated in this manner by the above-described method.More specifically, the rendering unit 215 generates an edge based on theswitching between the bit set to “0” and the bit set to “1” in thebinary bitmap contained in the bitmap edge, and renders the activeregion while omitting the rendering of the inactive region acquired fromthis edge. The rendering of the active region is performed based on thefill data contained in the display list. More specifically, if the imagedata having the α value is specified in the fill data, this leads to therendering with use of the α blending, and, in step S513, theintermediate data generation unit 210 generates the intermediate datausing the vector edge like the vector edge illustrated in FIG. 3C. Morespecifically, for the bitmap image data containing the α channel, theintermediate data generation unit 210 sets a pair of downward and upwardedges indicating the positions of the both ends of this bitmap imagedata as the vector edge, and generates intermediate data containing thisvector edge. The fill data in the intermediate data in this case isexactly the bitmap image data containing the α channel itself. Therendering unit 215 renders the display list containing the vector edgeby the above-described method. More specifically, if the image data isthe bitmap image data containing the α channel, the rendering unit 215renders each of the pixels by the α blending in the active regionbetween the both ends of the vector edge. This means that the α blendingis performed on the transparent pixel as well as the opaque pixel. Inother words, generating the intermediate data using the vector edgeincludes the intermediate data generation unit 210 generatinginformation indicating that each of the pixels contained in the bitmapimage data will be rendered (will be subject to the renderingprocessing).

Since the generation of the intermediate data corresponding to thesingle page is completed, in step S514, the rendering unit 215 performsthe rendering processing based on the generated intermediate data. Suchrendering processing is performed based on the type of the edge data(the vector edge, the bitmap edge, or the like) of the object that isexpressed in the intermediate data. The method for the renderingprocessing based on each type of the edge data is as described above.The bitmap image data corresponding to the single page is generated bythis rendering processing. Then, the rendering unit 215 stores thebitmap image data corresponding to the single page into the data storageunit 150. Then, the processing returns to step S502. This stored bitmapimage data is supplied to the printer device 130 by the job control unit200.

FIG. 6 is a detailed flow of the α determination processing in step S509illustrated in FIG. 5.

This α determination processing is performed to check whether not somany edges will be generated in the rendering processing even when theedge data is generated as the bitmap edge. This is because, if too manyedges are generated in the rendering processing, a demerit of a costincrease derived from edge processing in the rendering processingoverweighs a merit attained from performing the rendering processingonly on the active region.

In step S601, the intermediate data generation unit 210 initializes boththe “bitmap edge generation flag” and a “count value Cnt”, which arevariables, to “0”. Then, the processing proceeds to step S602.

In step S602, the intermediate data generation unit 210 selects adetermination line or determination lines in the bitmap image data. Thisdetermination line or each of these determination lines is a scan linein the bitmap image data, and is a scan line containing a plurality ofpixels for which the α value will be analyzed in steps S605 and S606,which will be described below. Selecting the determination line(s)allows the α determination processing to be performed with a smallercalculation amount than analyzing the α value of each of pixelscontained in all scan lines. The determination line(s) is or are atleast one or more scan line(s), and the determination line or each ofthe determination lines of this or these at least one or more scanline(s) corresponds to a predetermined region where the α value held bythe pixel will be analyzed. If the height of the bitmap image data is H(pixels), this or these determination line(s) is or are, for example, afirst line, an [H/2]-th line, and/or an H-th line. The notation [⋅] is agauss symbol, and [H/2] means a largest integer not greater than H/2.The method for selecting the determination line(s) is not limitedthereto. Then, the processing proceeds to step S603.

In step S603, the intermediate data generation unit 210 reads a singleline among unprocessed lines sequentially, starting from the first linein the bitmap image data containing the α channel, into a buffer in theRAM. Each of the pixels contained in the read line has the RGBα value.Then, the processing proceeds to step S604.

In step S604, the intermediate data generation unit 210 determineswhether the line read in step S603 is the determination line selected instep S602. If the read line is the determination line (YES in stepS604), the processing proceeds to step S605. If not (NO in step S604),the processing proceeds to step S607.

In step S605, the intermediate data generation unit 210 reads the αvalue of each of the pixels contained in the single line read in stepS603 into another buffer in the RAM. In this reading, the α value heldby each of the pixels is read into the buffer in a same arrangementorder as an arrangement order of the pixels contained in the read line.Then, the processing proceeds to step S606.

In step S606, the intermediate data generation unit 210 counts thenumber of position(s) (boundary position(s)) where the pixel having theα value indicating that this pixel is transparent and another pixel areadjacent to each other (how many times the α value indicating that thepixel is transparent is switched) in the line read in step S603. Anotherpixel means the pixel having the α value indicating that this pixel istranslucent or opaque. Then, the intermediate data generation unit 210adds the counted number to the count value Cnt. Then, the processingproceeds to step S607.

This counting will be described with reference to FIG. 7A. The number iscounted as “1” in a first line in the image data 701. On the other hand,the number is counted as “199” in a first line in the image data 702,because the α value indicating that the pixel is transparent is switchedfor each pixel in the object having the width of 200 pixels.

In step S607, the intermediate data generation unit 210 determineswhether all lines contained in the bitmap image data are processed. Ifthe α determination is completed for the all lines (NO in step S607),the processing proceeds to step S608. If not (if there is an unprocessedline) (YES in step S607), the processing returns to step S603.

In step S608, the intermediate data generation unit 210 calculates anedge density. The edge density corresponds to a ratio of the number ofedge(s) contained in the bitmap image data to the area of the bitmapimage data, and is defined by the following expression.EDGE DENSITY=((COUNT VALUE Cnt)÷(IMAGE WIDTH×NUMBER OF DETERMINATIONLINE(S)))

In the present exemplary embodiment, in the case of the image data 701,the count value Cnt is a cumulative total “2 (=1+0+1)” of the firstline, a twenty-fifth line, and a fiftieth line. The image width is“200”, and the number of determination line(s) is “3”. Therefore, theedge density is determined to be the edge density=(2)÷(200×3)=0.0033. Onthe other hand, in the case of the image data 702, the count value Cntis a cumulative total “597 (=199+199+199)” of the first line, atwenty-fifth line, and a fiftieth line. The image width is “200”, andthe number of determination line(s) is “3”. Therefore, the edge densityis determined to be the edge density=(597)÷(200×3)=0.995.

The processing proceeds to step S609, in which the intermediate datageneration unit 210 determines whether the edge density is a thresholdvalue or higher. If the edge density is lower than the threshold value(i.e., if a small number of edges will be generated in the renderingprocessing when the edge data is generated as the bitmap edge) (NO instep S609), the processing proceeds to step S610, in which theintermediate data generation unit 210 sets the “bitmap edge generationflag” to “1”. If the edge density is the threshold value or higher(i.e., if a large number of edges will be generated in the renderingprocessing when the edge data is generated as the bitmap edge) (YES instep S609), the intermediate data generation unit 210 ends the αdetermination processing with the “bitmap edge generation flag”remaining set to the initial value “0”.

FIG. 8A illustrates edges 801 generated in the processing for renderingthe image data 701. The edge data contained in the display list of thisimage data 701 is the bitmap edge. As understood from the edges 801, twodownward edges and two upward edges are generated in the renderingprocessing. Since the generated edges are four, the edge processingspends only a low cost. Further, the rendering unit 215 does not performthe processing for rendering the image data 701 on the inactive region,which can speed up the processing.

FIG. 8B illustrates edges 802 generated in the processing for renderingthe image data 702. The edge data contained in the display list of thisimage data 702 is the vector edge. As understood from the edges 802, onedownward edge and one upward edge are generated in the renderingprocessing.

Supposing that this image data 702 is processed by the renderingprocessing with use of the bitmap edge, FIG. 8C illustrates edges 803generated in this case. In the image data 702, the transparent pixel andthe opaque pixel are arranged alternately per pixel, so that an enormousnumber of edges are generated by the rendering processing with use ofthe bitmap edge. Therefore, the edge processing spends an excessivelyincreased cost, and therefore this method is inefficient. For thisreason, the image data 702 is processed by the rendering processing withuse of the vector edge.

In the present exemplary embodiment, the image forming apparatus 100switches whether to perform the rendering processing with use of thevector edge or perform the rendering processing with use of the bitmapedge according to the α value held by the pixel contained in the imagedata having the α channel. This method allows the image formingapparatus 100 to omit the α blending on the inactive region whileavoiding the increase in the cost spent to process the edge in therendering processing.

In other words, according to the present exemplary embodiment, moreflexible omission of the α blending can be achieved by, when renderingan image, omitting the α blending on a certain portion in this imagewhile performing the α blending on another portion in this image.

In the above-described exemplary embodiment, the PDL data is assumed tobe received from the host computer 170 via the LAN 160. However, theimage forming apparatus 100 may include a not-illustrated universalserial bus (USB) memory socket, and the control device 110 may read outthe PDL data directly from a USB memory inserted in this socket. In thiscase, each of the above-described processing procedures may be performedafter the read PDL data is stored into the data storage unit 150, or maybe performed with this USB memory regarded as the data storage unit 150.

Embodiment(s) of the present invention can also be realized by acomputer of a system or apparatus that reads out and executes computerexecutable instructions (e.g., one or more programs) recorded on astorage medium (which may also be referred to more fully as a‘non-transitory computer-readable storage medium’) to perform thefunctions of one or more of the above-described embodiment(s) and/orthat includes one or more circuits (e.g., application specificintegrated circuit (ASIC)) for performing the functions of one or moreof the above-described embodiment(s), and by a method performed by thecomputer of the system or apparatus by, for example, reading out andexecuting the computer executable instructions from the storage mediumto perform the functions of one or more of the above-describedembodiment(s) and/or controlling the one or more circuits to perform thefunctions of one or more of the above-described embodiment(s). Thecomputer may comprise one or more processors (e.g., central processingunit (CPU), micro processing unit (MPU)) and may include a network ofseparate computers or separate processors to read out and execute thecomputer executable instructions. The computer executable instructionsmay be provided to the computer, for example, from a network or thestorage medium. The storage medium may include, for example, one or moreof a hard disk, a random-access memory (RAM), a read only memory (ROM),a storage of distributed computing systems, an optical disk (such as acompact disc (CD), digital versatile disc (DVD), or Blu-Ray Disc (BD)™),a flash memory device, a memory card, and the like.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

This application claims the benefit of Japanese Patent Application No.2014-229911, filed Nov. 12, 2014, which is hereby incorporated byreference herein in its entirety.

What is claimed is:
 1. An image processing apparatus capable ofgenerating a composite image by combining plural images at leastincluding a foreground image and a background image, the imageprocessing apparatus comprising: at least one controller including aprocessor configured to execute a program stored in a memory or acircuit configured to implement a function, the at least one controllerbeing configured to: generate, in a case where the foreground imageincludes a plurality transparent pixels and a plurality ofsemi-transparent pixels and an arrangement state of the transparentpixels is a first arrangement state in the foreground image, thecomposite image by performing alpha blending to combine asemi-transparent pixel in the foreground image with a pixel in thebackground image and also performing alpha blending to combine atransparent pixel in the foreground image with a pixel in the backgroundimage; and generate, in a case where the foreground image includes aplurality of transparent pixels and a plurality of semi-transparentpixels and the arrangement state of the transparent pixels is a secondarrangement state in the foreground image, the second arrangement statebeing different from the first arrangement state, the composite image byperforming alpha blending to combine a semi-transparent pixel in theforeground image with a pixel in the background image and not performingalpha blending to combine a transparent pixel in the foreground imagewith a pixel in the background image.
 2. The image processing apparatusaccording to claim 1, wherein the at least one controller is capable ofperforming: a first generation process of generating the composite imageby performing alpha blending to combine a semi-transparent pixel in theforeground image with a pixel in the background image and alsoperforming alpha blending to combine a transparent pixel in theforeground image with a pixel in the background image; and a secondgeneration process of generating the composite image by performing alphablending to combine a semi-transparent pixel in the foreground imagewith a pixel in the background image and not performing alpha blendingto combine a transparent pixel in the foreground image with a pixel inthe background image, and wherein the at least one controllerdetermines, based on the foreground image, which of the first generationprocess and the second generation process is to be performed.
 3. Theimage processing apparatus according to claim 2, wherein the at leastone controller determines, based on a value related to a number oftransparent pixels in the foreground image, which of the firstgeneration process and the second generation process is to be performed.4. The image processing apparatus according to claim 2, wherein the atleast one controller determines, based on an edge density in theforeground image, which of the first generation process and the secondgeneration process is to be performed.
 5. The image processing apparatusaccording to claim 4, wherein the edge density is a value related to anumber of transparent pixels adjacent to non-transparent pixels and/or anumber of non-transparent pixels adjacent to transparent pixels.
 6. Theimage processing apparatus according to claim 4, wherein the at leastone controller performs, to obtain the edge density, an edge detectionprocess on scan lines that are a part of all scan lines in theforeground image.
 7. The image processing apparatus according to claim1, wherein, in a case where the arrangement state of the transparentpixels is the first arrangement state, the at least one controllerperforms alpha blending to combine a pixel in the foreground image witha pixel in the background image without distinguishing transparentpixels and non-transparent pixels included in the foreground image,wherein, in a case where the arrangement state of the transparent pixelsis the second arrangement state, the at least one controllerdistinguishes transparent pixels and non-transparent pixels included inthe foreground image and performs alpha blending to combine only thenon-transparent pixels with pixels in the background image.
 8. The imageprocessing apparatus according to claim 7, wherein the non-transparentpixels include a semi-transparent pixel and an opaque pixel.
 9. Theimage processing apparatus according to claim 1, wherein the at leastone controller generates the composite image by, based on an area of theforeground image being smaller than a predetermined value, performingalpha blending to combine a semi-transparent pixel in the foregroundimage with a pixel in the background image and performing alpha blendingto combine a transparent pixel in the foreground image with a pixel inthe background image.
 10. The image processing apparatus according toclaim 1, further comprising an image forming unit configured to form animage on a sheet, wherein the at least one controller causes the imageforming unit to perform image formation based on the composite image.11. The image processing apparatus according to claim 1, wherein, in acase where the arrangement state of the transparent pixels is the secondarrangement state, the at least one controller manages a pixel to besubjected to alpha blending and a pixel not to be subjected to alphablending by using a binary bitmap.
 12. The image processing apparatusaccording to claim 1, wherein the at least one controller obtains theforeground image and the background image based on XPS (ExtensibleMarkup Language Paper Specification) data or PDL (Page DescriptionLanguage) data.
 13. A method of generating a composite image bycombining plural images at least including a foreground image and abackground image, the method comprising: generating, in a case where theforeground image includes a plurality transparent pixels and a pluralityof semi-transparent pixel and an arrangement state of transparent pixelsis a first arrangement state in the foreground image, the compositeimage by performing alpha blending to combine a semi-transparent pixelin the foreground image with a pixel in the background image and alsoperforming alpha blending to combine a transparent pixel in theforeground image with a pixel in the background image; and generating,in a case where the foreground image includes a plurality of transparentpixels and a plurality of semi-transparent pixels and the arrangementstate of the transparent pixels is a second arrangement state in theforeground image, the second arrangement state being different from thefirst arrangement state, the composite image by performing alphablending to combine a semi-transparent pixel in the foreground imagewith a pixel in the background image and not performing alpha blendingto combine a transparent pixel in the foreground image with a pixel inthe background image.
 14. The method according to claim 13, furthercomprising: determining, based on the foreground image, which of thefirst generation process and the second generation process is to beperformed.
 15. The method according to claim 13, in a case where theforeground image includes a transparent pixel and a semi-transparentpixel and the arrangement state of the transparent pixels is the firstarrangement state, performing alpha blending to combine a pixel in theforeground image with a pixel in the background image withoutdistinguishing transparent pixels and non-transparent pixels included inthe foreground image, and in a case where the foreground image includesa transparent pixel and a semi-transparent pixel and the arrangementstate of the transparent pixels is the second arrangement state,distinguishing transparent pixels and non-transparent pixels included inthe foreground image and performs alpha blending to combine only thenon-transparent pixels with pixels in the background image.
 16. Themethod according to claim 13, further comprising generating thecomposite image by, based on an area of the foreground image beingsmaller than a predetermined value, and performing alpha blending tocombine a semi-transparent pixel in the foreground image with a pixel inthe background image and performing alpha blending to combine atransparent pixel in the foreground image with a pixel in the backgroundimage.
 17. A non-transitory computer-readable recording medium storing aprogram for causing a controller of an image processing apparatus toexecute control processing, the image processing apparatus being capableof generating a composite image by combining plural images at leastincluding a foreground image and a background image, the controlprocessing comprising: generating, in a case where the foreground imageincludes a plurality of transparent pixels and a plurality ofsemi-transparent pixel and an arrangement state of transparent pixels isa first arrangement state in the foreground image, the composite imageby performing alpha blending to combine a semi-transparent pixel in theforeground image with a pixel in the background image and alsoperforming alpha blending to combine a transparent pixel in theforeground image with a pixel in the background image; and generating,in a case where the foreground image includes a plurality of transparentpixel and a plurality of semi-transparent pixel and an arrangement stateof the transparent pixels is a second arrangement state in theforeground image, the second arrangement state being different from thefirst arrangement state, the composite image by performing alphablending to combine a semi-transparent pixel in the foreground imagewith a pixel in the background image and not performing alpha blendingto combine a transparent pixel in the foreground image with a pixel inthe background image.
 18. The non-transitory computer-readable recordingmedium according to claim 17, further comprising: determining, based onthe foreground image, which of the first generation process and thesecond generation process is to be performed.
 19. The non-transitorycomputer-readable recording medium according to claim 17, furthercomprising: in a case where the arrangement state of the transparentpixels is the first arrangement state, performing alpha blending tocombine a pixel in the foreground image with a pixel in the backgroundimage without distinguishing transparent pixels and non-transparentpixels included in the foreground image, and in a case where thearrangement state of the transparent pixels is the second arrangementstate, distinguishing transparent pixels and non-transparent pixelsincluded in the foreground image and performs alpha blending to combineonly the non-transparent pixels with pixels in the background image. 20.The non-transitory computer-readable recording medium according to claim17, further comprising generating the composite image by, based on anarea of the foreground image being smaller than a predetermined value,and performing alpha blending to combine a semi-transparent pixel in theforeground image with a pixel in the background image and performingalpha blending to combine a transparent pixel in the foreground imagewith a pixel in the background image.